/*
 * @描述: 
 * @作者: 约訂
 * @Date: 2024-06-12 10:09:35
 * @LastEditTime: 2024-06-21 14:43:36
 * @修改人员: 约訂
 */
import Vue from "vue";
import Router from "vue-router";
import Layout from "../layout/index";

Vue.use(Router);

export const constantRouterMap = [
         {
           path: "/login",
           meta: { title: "登录", keepAlive: true },
           component: resolve => require(["@/views/login"], resolve),
           hidden: true
         },
         {
           path: "/404",
           component: resolve =>
             require(["@/views/features/404"], resolve),
           hidden: true
         },
         {
           path: "/redirect",
           component: Layout,
           hidden: true,
           children: [
             {
               path: "/redirect/:path*",
               component: resolve =>
                 require(["@/views/features/redirect"], resolve)
             }
           ]
         },
         {
           path: "/",
           component: Layout,
           redirect: "/dashboard",
           children: [
             {
               path: "dashboard",
               component: resolve => require(["@/views/home/index"], resolve),
               name: "dashboard",
               meta: {
                 title: "控制台",
                 icon: "new-kongzhitai",
                 affix: true,
                 keepAlive: true
               }
             }
           ]
         }
       ];

export default new Router({
  mode: "history",
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap,
});
